<th:block th:if="${field instanceof T(org.broadleafcommerce.openadmin.web.form.entity.ComboField)}">
    <label th:for="*{fields['__${field.name}__'].value}" th:classappend="${field.required ? 'required' : ''}" >
        <span th:utext="#{${field.friendlyName}}"></span>
<span th:replace="components/fieldTooltip" ></span>
    </label>

    <select class="six" th:field="*{fields['__${field.name}__'].value}" th:if="${! #maps.isEmpty(field.options)}" th:disabled="${field.readOnly}">
        <option value="" th:text="#{Default_Select}" ></option>
        <option th:each="entry : *{fields['__${field.name}__'].options}"
                th:value="${entry.key}"
                th:text="${entry.value}" ></option>
    </select>
                
    <span th:if="${#maps.isEmpty(field.options)}" class="indented-form-value" th:inline="text">
        &lt;[[#{No_Records_Found_Enum}]]&gt;
    </span>
    
    <span class="error" th:errors="*{fields['__${field.name}__'].value}" ></span>

</th:block>

<div th:unless="${field instanceof T(org.broadleafcommerce.openadmin.web.form.entity.ComboField)}"
    class="additional-foreign-key-container twelve">
    <input type="hidden" class="display-value-property" th:value="*{fields['__${field.name}__'].foreignKeyDisplayValueProperty}"  />
    <input type="hidden" class="value" th:field="*{fields['__${field.name}__'].value}" th:attr="data-onchangetrigger=${field.onChangeTrigger}" />
    <input type="hidden" class="hidden-display-value" th:field="*{fields['__${field.name}__'].displayValue}" />

    <label th:for="*{fields['__${field.name}__'].value}" th:classappend="${field.required ? 'required' : ''}" >
        <span th:utext="#{${field.friendlyName}}"></span>
<span th:replace="components/fieldTooltip" ></span>
    </label>

    <div class="foreign-key-value-container">
        
        <th:block th:unless="${field.isTypeaheadEnabled}">


            <div class="input-group">
                <input class="display-value-none-selected form-control" type="text" style="display: none;" readonly="readonly" th:value="#{No_Value_Selected}" />
                <input class="display-value read-only form-control" type="text" th:value="*{fields['__${field.name}__'].displayValue}" readonly="readonly"/>
                <span class="input-group-btn">
                    <button class="clear-foreign-key secondary button"
                            th:classappend="${field.readOnly}? 'read-only'"
                            th:disabled="${field.readOnly}"
                            type="button" th:inline="text"
                            th:unless="${field.required}"
                            th:style="*{#strings.isEmpty(fields['__${field.name}__'].value) ? 'display:none' : ''}">
                        <i class="fa fa-times"></i>
                    </button>

                    <button class="to-one-lookup secondary button"
                            th:classappend="${field.readOnly}? 'read-only'"
                            th:disabled="${field.readOnly}"
                            type="button" th:inline="text"
                            th:attr="data-select-url=@{${'/' + field.owningEntityClass + '/' + #uris.escapePathSegment(field.name) + '/select'}(requestingEntityId=${entityForm.id}, sectionCrumbs=${entityForm.sectionCrumbs})},
                                 data-dynamic-field=${field.attributes['dynamicField']},
                                 data-confirm=${field.isConfirmEnabled},
                                 data-confirm-text=${field.confirmEnabledText}">
                        <i class="blc-icon-search"></i>
                    </button>
                </span>
            </div>



        </th:block>

        <th:block th:if="${field.isTypeaheadEnabled}">
            <input type="text" class="to-one-typeahead twelve"
                th:disabled="${field.readOnly}"
                th:placeholder="#{typeahead.placeholder(#{${field.friendlyName}})}"
                th:value="*{fields['__${field.name}__'].displayValue}"
                th:attr="data-typeahead-url=@{${'/' + field.owningEntityClass + '/' + #uris.escapePathSegment(field.name) + '/typeahead'}(requestingEntityId=${entityForm.id}, sectionCrumbs=${entityForm.sectionCrumbs})}" />
        </th:block>

        <span class="error" th:errors="*{fields['__${field.name}__'].value}" ></span>
    </div>
    
</div>
